<template>
  <div>
    <el-container>
      <el-header height="100px"
        >xxx公司后台管理系统
        <div class="box">欢迎{{ $store.getters.getUser.username }}登录！</div>
        <!-- <div class="box">欢迎登录！</div> -->
        <el-button type="danger" @click="layou">退出</el-button>
      </el-header>

      <el-container>
        <el-aside width="260px">
          <v-nav></v-nav>
        </el-aside>
        <el-main>
          <!-- 二级路由出口 -->
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import vNav from "@/components/vNav.vue";
export default {
  data() {
    return {};
  },
  components: {
    vNav,
  },
  methods: {
    // 退出登录
    layou() {
      // 清空存储
      this.$store.dispatch("changeUserAction", false);
      // 返回登录页
      this.$router.push("/login");
    },
  },
};
</script>
<style lang="less" scoped>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.box {
  // width: 200px;
  // height: 100px;/
  float: left;
  padding-top: 50px;
}
.el-button--danger {
  float: right;
  margin-top: 50px;
  margin-right: 20px;
}
</style> 